﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
    [DataContract, Table("IcmMasPurchaseRegular")]
    public class MasPurchaseRegular
    {
        public MasPurchaseRegular()
        {
            //RecordStatus = SYS.RecordStatus.UsedStatus;
            //CreatedWhen = DateTime.Now;
            
            //Mappings = new HashSet<MasPurchaseRegularMapping>();
            
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "RegularId", ResourceType = typeof(Resources.MasPurchaseRegularResource))]
        public int RegularId { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "Name", ResourceType = typeof(Resources.MasPurchaseRegularResource))]
        public string Name { get; set; }

        [DataType(DataType.MultilineText)]
        [DataMember, Display(Name = "Description", ResourceType = typeof(Resources.MasPurchaseRegularResource))]
        public string Description { get; set; }

        [EnumDataType(typeof(SYS.RecordStatus.EnumRecordStatus))]
        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.MasPurchaseRegularResource))]
        public string RecordStatus { get; set; }

        public int? CreatedBy { get; set; }
        public DateTime? CreatedWhen { get; set; }
        public int? UpdatedBy { get; set; }
        public DateTime? UpdatedWhen { get; set; }

        //[DataMember]
        //public ICollection<MasPurchaseRegularMapping> Mappings { get; set; }

        //public MasPurchaseRegularMapping CreateMapping()
        //{
        //    var m = new MasPurchaseRegularMapping();

        //    Mappings.Add(m);

        //    return m;
        //}
    }
}
